package vip.fuxk.blog.utils;

import org.noear.solon.Solon;

public class PropKit {

    public static String getPropResultPath(String key,String defaultValue){
        String codePath =
                Solon.cfg().getProperty(key,defaultValue)
                        .trim().replaceAll("[\\s\\n\\t]+","");
        if(codePath.trim().length()==0 ){
            codePath = defaultValue;
        }
        codePath = "/".concat(codePath).concat("/").replaceAll("/+","/");
        return codePath;
    }

    public static String getAdminThemePath(){
        return PropKit.getPropResultPath("fuxk.admin-theme","/admin/");
    }

    public static String getFrontThemePath(){
        return PropKit.getPropResultPath("fuxk.front-theme","/front/");
    }

    public static String getCodePath(){
       return PropKit.getPropResultPath("fuxk.code-path","/code/");
    }


}
